package root.loan;

import exceptions.HasAlreadyDoneException;
import exceptions.PermissionDeniedException;

/**
 * Status de requisicao de emprestimo de item. 
 */
public class Request extends State{
	private final String descricao = "Requisição";
	@Override
	public String getDescricao() {
		return descricao;
	}
	@Override
	public boolean isRequest(){
		return true;
	}
	@Override
	public void aproveBorrow(Borrow borrow){
		mudaEstado(borrow,new Accepted());
	}
	@Override
	public void cancel(Borrow borrow) throws HasAlreadyDoneException ,PermissionDeniedException{
		throw new PermissionDeniedException("Emprestimo não aprovado");
	}
	@Override
	public void complete(Borrow borrow) throws HasAlreadyDoneException ,PermissionDeniedException{
		throw new PermissionDeniedException("Emprestimo não aprovado");
	}
	@Override
	public void requestDevolution(Borrow borrow) throws HasAlreadyDoneException ,PermissionDeniedException {
		throw new PermissionDeniedException("Emprestimo não aprovado");
	}
	@Override
	public void returnItem(Borrow borrow) throws HasAlreadyDoneException ,PermissionDeniedException {
		throw new PermissionDeniedException("Emprestimo não aprovado");
	}
}
